<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>后台管理系统-二级分类</title>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="assets/bootstrap-validator/css/bootstrapValidator.min.css"/>
    <link rel="stylesheet" href="assets/nprogress/nprogress.css"/>
    <link rel="stylesheet" href="css/admin.css"/>
    <style>
        [name="pic1"] {
            width: 82px;
            height: 34px;
            overflow: hidden;
            display: block;
            opacity: 0;
            position: absolute;
            left: 0;
            top: 0;
        }
    </style>
</head>
<body>
<!--侧边栏-->
<aside class="ad_aside">
    <!--商标-->
    <div class="brand"><a href="index.html">ITCAST</a></div>
    <!--用户-->
    <div class="user">
        <img src="images/default.png" alt=""/>
        <span>超级管理员</span>
    </div>
    <!--菜单-->
    <div class="menu">
        <ul>
            <li><a href="userManage.html"><span class="glyphicon glyphicon-user"></span> 用户管理</a></li>
            <li class="now">
                <a href="javascript:;"><span class="glyphicon glyphicon-list"></span> 分类管理</a>
                <div class="child">
                    <a href="categoryFirst.html">一级分类</a>
                    <a class="now" href="categorySecond.html">二级分类</a>
                </div>
            </li>
            <li><a href="productManage.html"><span class="glyphicon glyphicon-tags"></span> 商品管理</a></li>
        </ul>
    </div>
</aside>
<!--内容-->
<section class="ad_section">
    <!--顶部导航-->
    <nav class="ad_nav">
        <a data-menu href="javascript:;"><span class="glyphicon glyphicon-align-justify"></span></a>
        <a data-logout href="javascript:;"><span class="glyphicon glyphicon-log-out"></span></a>
    </nav>
    <div class="container-fluid">
        <!--路径导航-->
        <ol class="breadcrumb">
            <li><a href="#">管理系统</a></li>
            <li class="active">分类管理</li>
            <li class="active">二级分类</li>
        </ol>
        <div class="ad_content">
            <button class="btn btn-default mb_15" data-toggle="modal" data-target=".modalCategory">添加分类</button>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>#</th>
                    <th>一级分类名称</th>
                    <th>二级分类名称（品牌）</th>
                    <th>品牌logo</th>
                </tr>
                </thead>
                <tbody></tbody>
            </table>
            <!--分页-->
            <nav class="text-right">
                <ul class="pagination"></ul>
            </nav>

        </div>
    </div>
</section>
<div class="modal fade modalCategory">
    <div class="modal-dialog">
        <div class="modal-content modal-sm">
            <div class="modal-header message-danger">
                <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
                <h4 class="modal-title">添加分类</h4>
            </div>
            <div class="modal-body">
                <form id="form">
                    <div class="form-group">
                        <label>一级分类</label>
                       <!--下拉菜单-->
                        <div class="dropdown btn-group">
                            <button id="dLabel" type="button" data-toggle="dropdown">
                                <span class="categoryName">请选择</span>
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                <!--todo-->
                            </ul>
                        </div>
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control secondCategoryName" placeholder="请输入二级分类名称" name="brandName">
                    </div>
                    <div class="form-group" style="position: relative">
                        <button class="btn btn-default">上传图片</button>
                        <!--用文件上传插件把文件提交到后台，再转移到前端指定的文件里-->
                        <input type="file" name="pic1" data-url="/category/addSecondCategoryPic" id="fileUpload">
                        <!--把文件地址提交到后台，存储起来-->
                        <input type="hidden" name="brandLogo">
                    </div>
                    <img src="images/none.png" alt="" width="100px" height="100px" class="picture">
                    <!--序列化表单数据，只能获得提交上去的值-->
                    <input type="hidden" name="categoryId">
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-primary submit" form="form">确定</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script type="text/template" id="list">
    <% for(var i=0; i < rows.length; i++) {%>
    <tr>
        <th scope="row"><%=(i+1)+(page-1)*size%></th>
        <td><%=rows[i].categoryName%></td>
        <td><%=rows[i].brandName%></td>
        <td><img src="<%=rows[i].brandLogo%>" alt="" width="40px" height="40px"></td>
    </tr>
    <% } %>
</script>
<script type="text/template" id="slideList">
    <%for(var i=0; i < rows.length; i++) {%>
        <li data-id="<%=rows[i].id%>"><%=rows[i].categoryName%></li>
    <% } %>
</script>
<script src="assets/jquery/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/nprogress/nprogress.js"></script>
<script src="assets/artTemplate/template-native.js"></script>
<script src="assets/bootstrap-paginator/bootstrap-paginator.js"></script>
<!--文件上传插件-->
<script src="assets/jquery-fileupload/jquery.ui.widget.js"></script>
<script src="assets/jquery-fileupload/jquery.fileupload.js"></script>
<script src="assets/bootstrap-validator/js/bootstrapValidator.min.js"></script>
<script src="js/admin.js"></script>
<script src="js/categorySecond.js"></script>
</body>
</html>